﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using SmartCity.Shared;
using Volo.Abp.Domain.Entities;

namespace CommonManagement
{
    /// <summary>
    /// 订单类
    /// </summary>
    public class Order : BasicAggregateRoot<int>
    {
        /// <summary>商家</summary>
        public string Name { get; protected set; }

        /// <summary>用户编号</summary>
        public int UserId { get; protected set; }

        /// <summary>订单编号</summary>
        public string No { get; protected set; }

        /// <summary>金额</summary>
        public int Amount { get; protected set; }

        /// <summary>状态</summary>
        public OrderStatus Status { get; protected set; }

        /// <summary>支付时间</summary>
        public DateTime? PayTime { get; protected set; }

        /// <summary>订单类型</summary>
        public string Type { get; protected set; }

        /// <summary>订单类型名称</summary>
        public string TypeName { get; protected set; }

        /// <summary>用户</summary>
        [ForeignKey("UserId")]
        public User User { get; protected set; }

        private Order() { }
    }
}